Media Service API
Media Service API Documentation
Version: 1.2.1
Paths
Healthcheck API
/media-services/api/v1/healthz/
- Method: GET
- Summary: Health Check
- Description: Return Health Status.
- Responses:
- 200:
- Description: Successful Response
- Content-Type: application/json
- 200:
Media Service Generation API
/media-services/api/v1/
- Method: POST
- Summary: Generate Media Service for single file
- Description: Generate transcription, description, metadata and thumbnail for a single media file (audio/video).
Request Payload:
Type | Parameter | Description | Data Type | Is Optional |
---|---|---|---|---|
Form Data | choice_model_selection | AI model selection (whisper) | String | No |
Form Data | media_type | Select the type of uploaded file (audio/video) | String | No |
Form Data | input_media | Upload a single audio/video file | File (.mp3, .mp4, .mpeg, .wav, .webm) | No |
Form Data | description | Enable detailed description generation | boolean | Yes |
Form Data | description_length | Desired length of generated description (25-500) | integer | Yes |
Form Data | metadata | Enable metadata generation | boolean | Yes |
Form Data | thumbnail | Enable thumbnail generation (only supported for video files) | boolean | Yes |
Sample Code :
import requests
url = "https://api-genai-dev.learningmate.co/media-services/api/v1/"
file_path = "your file path here"
token = "your token here"
headers = {
"accept": "application/json",
"Authorization": f"Bearer {token}",
}
data = {
"choice_model_selection": "whisper",
"media_type": "audio",
"description": "true",
"description_length": "225",
"metadata": "true",
"thumbnail": "false",
}
files = {
"input_media": (file_path, open(file_path, "rb"), "audio/wav"),
}
response = requests.post(url, headers=headers, data=data, files=files)
Example Response:
{
"status_code": 200,
"message": "SUCCESS::MediaService generated successfully",
"file_name": "Your filename will appear here",
"transcription": "Transcription will appear here",
"description_text": "Description will appear here",
"metadata_output": {
"title": "Title will appear here",
"description": "Description will appear here",
"genre": ["Genre will appear here"],
"creator": "Creator will appear here",
"keywords": ["Keywords will appear here"],
"custom": "custom will appear here"
},
"thumbnail_output": "Thumbnail will appear here"
}
Responses:
Status Code | Description | Content-Type |
---|---|---|
200 | Successful Response | application/json |
201 | Successful Creation | application/json |
400 | Bad Request | application/json |
413 | Request Entity Too Large | application/json |
415 | Unsupported Media Type | application/json |
422 | Unprocessable Entity | application/json |
500 | Internal Server Error | application/json |